import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;

public class MainPanel extends JPanel {
	private JTabbedPane tabs;
	private JPanel welcomePanel;
	private JLabel welcome1, welcome2;
	private JButton logout;
	// INSERT OTHER CLASSES
	private ManagePatientsFrame managePatients;

	public MainPanel(int ID, int userType)
	{
		//---- OBJECT INITIALIZATION ----//
		setLayout(new GridLayout(1, 1));
		tabs = new JTabbedPane();
		welcomePanel = new JPanel();
		welcome1 = new JLabel("Mercy Hospital");
		welcome2 = new JLabel("Welcome, John Doe.");
		logout = new JButton("Log Out");

		//---- WELCOME PANEL ----//
		welcomePanel.setLayout(new BoxLayout(welcomePanel, BoxLayout.PAGE_AXIS));
		welcomePanel.add(welcome1);
		welcomePanel.add(welcome2);
		welcomePanel.add(logout);
		welcome1.setAlignmentX(Component.CENTER_ALIGNMENT);
		welcome2.setAlignmentX(Component.CENTER_ALIGNMENT);
		logout.setAlignmentX(Component.CENTER_ALIGNMENT);

		//---- POPULATE TABS ----//
		tabs.addTab("Main", welcomePanel);
		switch(userType) {
			case 0:		// Patient
				// my health panel
				YourHealth yourHealth = new YourHealth (ID, userType);
				ManageAccount manage = new ManageAccount (ID, userType);
                                tabs.addTab("Your Health", yourHealth);
                                tabs.addTab("Manage Account", manage);
				break;
			case 3:		// Admin
				// staff panel
			case 1:		// Doctor
			case 2:		// Nurse
				managePatients = new ManagePatientsFrame(ID, userType);
				tabs.addTab("Patients", managePatients);
				break;
		}
		add(tabs);
	}
}